package com.link.base.base.autoconfig.autoconfig.service;

import com.link.base.base.autoconfig.autoconfig.model.FileExport;
import com.link.base.base.autoconfig.autoconfig.model.LnkInnerObject;
import com.link.core.basic.service.BasicService;

import java.util.List;
import java.util.Map;

public interface LnkInnerObjectService extends BasicService<LnkInnerObject> {

    /**
     * <p>生成建表语句</p>
     *
     * @author huanganbang、yrf
     * @param record
     * @return
     * @throws Exception
     */
    public String newTable(LnkInnerObject record) throws Exception;

    /**
     * <p>生成查询Sql语句</p>
     *
     * @author huanganbang、yrf
     * @param record
     * @return
     * @throws Exception
     */
    public String newQueryTable(LnkInnerObject record) throws Exception;

    /**
     * <p>生成工程对象</p>
     *
     * @author yrf
     * @param record
     * @return
     * @throws Exception
     */
    public Map<String, String> newObjectFile(LnkInnerObject record) throws Exception;

    /**
     * <p>生成工程对象</p>
     * 重载了newObjectFile(LnkInnerObject record)方法
     *
     * @author heqiqian
     * @param id 自动配置id
     */
    List<FileExport> newObjectFile(Long id) throws Exception;

    /**
     * <p>生成移动端工程对象</p>
     *
     * @author yrf
     * @param record
     * @return
     * @throws Exception
     */
    // public Map<String, String> newAppFile(LnkInnerObject record) throws Exception;

    public String Check(LnkInnerObject record) throws Exception;

    public void DeepCopy(LnkInnerObject record) throws Exception;

    public void getmodelinfo(LnkInnerObject record) throws Exception;

    public void updatemodelinfo(LnkInnerObject record) throws Exception;

    /**
     * <p>获取完整配置对象信息</p>
     *
     * @author yrf
     * @param record
     * @return
     * @throws Exception
     */
    public LnkInnerObject getFullLnkInnerObjectById(LnkInnerObject record) throws Exception;

    /**
     * 生成对列更新，插入带if标签判断的sqlmapper代码
     *
     * @param record 头记录
     * @param dataBaseType 数据库类型，mysql、oracle
     * @param genIfTestTag 是否为更新、插入语句添加if test标签
     * @return
     * @throws Exception
     */
    public String newSqlMapper(LnkInnerObject record, String dataBaseType, boolean genIfTestTag) throws Exception;

    public String test(LnkInnerObject record) throws Exception;

    /**
     * 更新版本部署id
     * @param id 记录id
     * @param deployId 代码版本id
     */
    void deployIdUpdate(Long id, Long deployId);
}
